package com.ss.android.account;

import android.accounts.Account;
import android.content.AbstractThreadedSyncAdapter;
import android.content.ContentProviderClient;
import android.content.Context;
import android.content.Intent;
import android.content.SyncResult;
import android.os.Bundle;

import com.ss.android.common.app.AppHooks;
import com.ss.android.common.app.AppHooks.InitHook;

public final class AccountSyncAdapter extends AbstractThreadedSyncAdapter {
    public AccountSyncAdapter(Context context) {
        super(context, true);
    }

    public final void onPerformSync(Account account, Bundle bundle, String arg6, ContentProviderClient contentProviderClient, SyncResult syncResult) {
        if (this.getContext() != null) {
            try {
                InitHook initHook = AppHooks.getInitHook();
                if (initHook != null) {
                    initHook.tryInit(this.getContext());
                    return;
                }
                this.getContext().startService(new Intent(this.getContext(), Class.forName("com.ss.android.newmedia.message.MessageHandler")));
            } catch (Throwable throwable) {
            }
        }
    }
}

